export default function(Vue) {
  // 获取当前目录下以js结尾的文件
  const files = require.context("./", true, /index\.js$/);
  const fileList = files.keys();
  // console.log(fileList, "fileList");
  fileList.map(it => {
    let value = files(it).default || files(it);
    // console.log(value, "value");
    // directiveName 指令名称，  value[directiveName] 指令内容
    let directiveName = Object.keys(value)[0];
    // console.log(directiveName, "directive");
    Vue.directive(directiveName, value[directiveName]);
  });
}

